﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GrayParrot.Extensions.Strings
{
    public static partial class StringExtensions
    {
        public static string RemoveLast(this string text)
        {
            if (text.Length < 1) return text;
            return text.Remove(text.Length - 1, 1);
        }

        public static string RemoveLast(this string text, string character)
        {
            if (text.Length < 1) return text;
            return text.Remove(text.LastIndexOf(character), character.Length);
        }
    }
}
